/**
 * Created by wust on 2019-11-06 15:11:11
 * Copyright © 2019 wust. All rights reserved.
 */
package com.wust.smartcity.admin.server.core.api.feign.server;

import com.wust.smartcity.admin.server.core.dao.SysProjectMapper;
import com.wust.smartcity.common.annotations.FeignApi;
import com.wust.smartcity.common.dto.WebResponseDto;
import com.wust.smartcity.common.entity.sys.project.SysProject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

/**
 * @author: wust
 * @date: Created in 2019-11-06 15:11:11
 * @description:
 *
 */
@FeignApi
@RequestMapping("/api/feign/v1/ProjectFeignApi")
@RestController
public class ProjectFeignApi {
    @Autowired
    private SysProjectMapper sysProjectMapper;

    @RequestMapping(value = "/selectAll",method= RequestMethod.POST)
    public WebResponseDto selectAll() {
        WebResponseDto responseDto = new WebResponseDto();
        List<SysProject> projects = sysProjectMapper.selectAll();
        responseDto.setLstDto(projects);
        return responseDto;
    }


    @RequestMapping(value = "/select",method= RequestMethod.POST)
    public WebResponseDto select(@RequestBody SysProject search) {
        WebResponseDto responseDto = new WebResponseDto();
        List<SysProject> projects = sysProjectMapper.select(search);
        responseDto.setLstDto(projects);
        return responseDto;
    }
}
